package com.pro.springbootshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pro.springbootshop.entity.Buyer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface BuyerMapper extends BaseMapper<Buyer> {
    @Select("select * from buyer where buyer_id=#{buyerId} and buyer_pw=#{buyerPw}")
    Buyer buyerLogin(String buyerId,String buyerPw);
    @Select("select * from buyer where buyer_id=#{buyerId}")
    Buyer getBuyerByBuyerId(String buyerId);
    @Update("update buyer set buyer_pw = #{buyerPw} where buyer_id=#{buyerId}")
    void updatePassword(String buyerPw,String buyerId);
    @Select("select * from buyer limit #{pageNo},#{limit}")
    List<Buyer> sellerGetBuyer(int pageNo,int limit);
}
